package stack;

public class ArrayStackDemo {
    public static void main(String[] args) {
        ArrayStack stack = new ArrayStack(5);
        for (int i = 0; i < 6; i++) {
            stack.push(i);
        }
        stack.list();
        System.out.println("==================");
        for (int i = 0; i < 10; i++) {
            try {
                System.out.println(stack.pop());
            } catch (Exception e) {
                System.out.println( e.getMessage());
            }
        }
    }
}

